<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>登录用户中心 | 时刻报警服务平台</title>
    <script type="text/javascript">
        if(window.top != window) {
            alert("您太久没有操作，系统已为您自动退出登录！");
            window.top.location.reload();
        }
    </script>
  <meta name="description" content="这是一个 index 页面">
  <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="${staticPath}/userend/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="${staticPath}/userend/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="${staticPath}/userend/css/amazeui.min.css" />
  <link rel="stylesheet" href="${staticPath}/userend/css/admin.css">
  <link rel="stylesheet" href="${staticPath}/userend/css/app.css">
</head>

<body data-type="login">

  <div class="am-g myapp-login">
	<div class="myapp-login-logo-block tpl-login-max">
		<div class="myapp-login-logo-text">
			<div class="myapp-login-logo-text" style="font-family: Sans-serif">
                <i class="am-icon-skyatlas"></i><span> 用户中心</span>
				
			</div>
		</div>

		<div class="login-font">
			<i>注册新账号 </i> | <span> 忘记密码?</span>
		</div>
		<div class="am-u-sm-10 login-am-center">
			<form id="loginForm" class="am-form">
				<fieldset>
					<div class="am-form-group">
						<input type="text" id="username" name="username" class="" id="doc-ipt-email-1" placeholder="请输入账号">
					</div>
					<div class="am-form-group">
						<input type="password" id="password" name="password" class="" id="doc-ipt-pwd-1" placeholder="请输入密码">
					</div>
					<p><button type="button" class="am-btn am-btn-default" onclick="login()">登录</button></p>
				</fieldset>
			</form>
		</div>
	</div>
</div>

  <script src="${staticPath}/userend/js/jquery.min.js"></script>
  <script src="${staticPath}/userend/js/amazeui.min.js"></script>
  <script src="${staticPath}/userend/js/app.js"></script>
  <script type="text/javascript" src="${staticPath}/admin/lib/layer/layer.js"></script>

  <script type="text/javascript">

      var progress = $.AMUI.progress;

      function login() {
          requestLogin();
      }
      function requestLogin() {
          progress.start();
          $.post('${ctx}/userend/login',$('#loginForm').serialize(),function(resp) {
              progress.done();
              if(resp.code == 'OK') {
                  window.location.href = '${ctx}/userend/index';
              }else {
                  window.parent.layer.msg(resp.message, {icon: 2});
              }
          },'json');
      }
//      $(function() {
//
//          $('#loginForm').keyup(function(event){
//              if(event.which == 13
//                      && $('#username').val().length > 0
//                      && $('#password').val().length > 0)
//                  login();
//          });
//      });
  </script>
</body>

</html>